home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / Mailcheck Source / MacTcpIncludes / UDPPB.h < prev   
Encoding:
C/C++ Source or Header  |  1990-01-30  |  2.0 KB  |  95 lines  |  [TEXT/MPS ]

  1. /* 
  2.     UDPPB.h    
  3.     C definitions of parameter block entries needed for UDP calls
  4.  
  5.     Copyright Apple Computer, Inc. 1988-89 
  6.     All rights reserved
  7.         
  8. */
  9.  
  10. #define UDPCreate        20
  11. #define UDPRead            21
  12. #define UDPBfrReturn    22
  13. #define UDPWrite        23
  14. #define UDPRelease        24
  15. #define UDPMaxMTUSize    25
  16. #define UDPCtlMax        29
  17.  
  18. typedef enum UDPEventCode {
  19.     UDPDataArrival = 1,
  20.     UDPICMPReceived,
  21.     lastUDPEvent = 65535
  22.     };
  23.  
  24. #ifndef THINK_C
  25. typedef pascal void (*UDPNotifyProc) (
  26.         StreamPtr udpStream, 
  27.         unsigned short eventCode, 
  28.         Ptr userDataPtr,
  29.         struct ICMPReport *icmpMsg);
  30.  
  31. typedef void (*UDPIOCompletionProc) (struct UDPiopb *iopb);
  32. #else
  33. typedef void (*UDPNotifyProc) (
  34.         StreamPtr udpStream, 
  35.         unsigned short eventCode, 
  36.         Ptr userDataPtr,
  37.         struct ICMPReport *icmpMsg);
  38.  
  39. typedef void (*UDPIOCompletionProc) (struct UDPiopb *iopb);
  40. #endif
  41.  
  42. typedef    unsigned short    udp_port;
  43.  
  44. typedef struct UDPCreatePB {            /* for create and release calls */
  45.     Ptr             rcvBuff;
  46.     unsigned long    rcvBuffLen;
  47.     UDPNotifyProc    notifyProc;
  48.     unsigned short    localPort;
  49.     Ptr                userDataPtr;
  50. } UDPCreatePB;
  51.     
  52. typedef struct UDPSendPB {
  53.     unsigned short    reserved;
  54.     ip_addr            remoteHost;
  55.     udp_port        remotePort;
  56.     Ptr                wdsPtr;
  57.     Boolean            checkSum;    
  58.     unsigned short    sendLength;
  59.     Ptr                userDataPtr;
  60. } UDPSendPB;
  61.     
  62. typedef struct UDPReceivePB {        /* for receive and buffer return calls */
  63.     unsigned short    timeOut;
  64.     ip_addr            remoteHost;
  65.     udp_port        remotePort;
  66.     Ptr             rcvBuff;
  67.     unsigned short    rcvBuffLen;
  68.     unsigned short    secondTimeStamp;
  69.     Ptr                 userDataPtr;
  70. } UDPReceivePB;
  71.  
  72. typedef struct UDPMTUPB {
  73.     unsigned short     mtuSize;
  74.     ip_addr            remoteHost;
  75.     Ptr                userDataPtr;
  76. } UDPMTUPB;
  77.  
  78. typedef struct UDPiopb {
  79.     char                 fill12[12];
  80.     UDPIOCompletionProc    ioCompletion;
  81.     short                 ioResult;
  82.     char                 *ioNamePtr;        
  83.     short                 ioVRefNum;        
  84.     short                ioCRefNum;            
  85.     short                 csCode;
  86.     StreamPtr             udpStream;                
  87.     union {
  88.         struct UDPCreatePB    create;
  89.         struct UDPSendPB    send;
  90.         struct UDPReceivePB    receive;
  91.         struct UDPMTUPB        mtu;
  92.     } csParam;
  93. } UDPiopb;
  94.     
  95.